import * as t from "@babel/types";
import { parse } from "@babel/parser";
import _template from "@babel/template";
const template = _template.default;
import fs from 'fs';
// console.log(t.memberExpression(t.memberExpression(t.identifier('this'), t.identifier('props')), t.identifier('children')))
fs.writeFileSync('./test.ast.json', JSON.stringify(template(`export default function test(props) { return <div props={props.children}></div> }`, { plugins: ['jsx'] })(), null, 4));